<?php

class Adept_Renderer_TextBox extends Adept_Renderer_Composite 
{
    
    /**
     * @param Adept_Component_TextBox $component
     */
    public function renderBegin($component) 
    {        
        $attributes = array(
            'id' => $component->getId(),
            'type' => 'text',
            'class' => $component->getClass(),
            'style' => $component->getStyle(),
            'name' => $component->getName(),
            'value' => $component->getDisplayValue(),
            'size' => $component->getSize(),
            'maxlength' => $component->getMaxLength(),
            'accesskey' => $component->getAccessKey(),
            'alt' => $component->getAlt(),
            'disabled' => $component->isDisabled() ? 'true' : null,
            'tabindex' => $component->getTabIndex(),
            'readonly' => $component->isReadOnly() ? 'true' : null,
        );        
        //$attributes = array_merge($attributes, $component->getBrowserEvents());
        
        $component->getWriter()->writeHtmlTag('input', $attributes, true);
    }        
    
}
